package ckw.database;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import core.modules.database.SuperSummaryPackage;

public class SummaryPackage extends SuperSummaryPackage implements Serializable {

	private static final long serialVersionUID = -6552518162209448672L;
	
	private Set<OKWElectionResult> okwElectionResults = new HashSet<OKWElectionResult>();
	private Set<Voter> voters = new HashSet<Voter>();

	public SummaryPackage() {
		super();
	}

	public Set<OKWElectionResult> getOkwElectionResults() {
		return okwElectionResults;
	}

	public void setOkwElectionResults(Set<OKWElectionResult> okwElectionResults) {
		this.okwElectionResults = okwElectionResults;
	}

	public Set<Voter> getVoters() {
		return voters;
	}

	public void setVoters(Set<Voter> voters) {
		this.voters = voters;
	}
	
	public void addToVoter(Voter voter){
		getVoters().add(voter);
		voter.getSummaryPackages().add(this);
	}
	
	public void removeFromVoter(Voter voter){
		getVoters().remove(voter);
		voter.getSummaryPackages().remove(this);
	}
	
	public void removeFromOKW_Election(OKW_Election okw_Election){
		okw_Election.setSummaryPackage(null);
	}
}
